#include <iostream>
int *func()
{
    int *a = new int(10); // 堆中分配内存
    return a;
}

int main()
{

    int *p = func();

    std::cout << *p << std::endl;
    std::cout << *p << std::endl;

    return 0;
}